﻿@model IEnumerable<blacksoft.Models.DocumentoVenta>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutVentas.cshtml";
}




<div class="block big" style="padding-top:50px">
    @using (Html.BeginForm("Index", "DocumentoVenta", FormMethod.Get))
    {
        <h4><b>Buscar Documento de Venta</b></h4>
        <hr />
        <div class="form">
            <center>
                <table>
                    <tr>
                        <td>
                            <div>
                                @Html.Label("", "Código del Doc. de Venta", new { @style = "width:auto" })
                            </div>
                        </td>
                        <td>
                            <div>
                                @Html.Label("", "Fecha de Pago", new { @style = "width:auto" })
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="input validate[required] tipright">
                                @Html.TextBox("tb_CodDocVenta")
                            </div>
                        </td>
                        <td>
                            <div class="input validate[required] tipright">
                                @Html.TextBox("tb_FechaPago", "", new { @type = "date" })
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div>
                                @Html.Label("", "Estado", new { @style = "width:auto" })
                            </div>
                            <div class="input validate[required] tipright">
                                @Html.DropDownList("ddl_Estado",
                                                    new[] {
                                                            new SelectListItem() {Text = "ACTIVO", Value="ACTIVO"},
                                                            new SelectListItem() {Text = "ANULADO", Value="ANULADO"},
                                                           },
                                                    "Seleccione",
                                                    new { @style = "width:163px" })


                            </div>
                        </td>
                    </tr>


                    <tr>
                        <td colspan="2">
                            <div>
                                @Html.Label("", "CLIENTE:")
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div>
                                @Html.Label("", "Cliente", new { @style = "width:auto" })
                            </div>
                        </td>
                        <td>
                            <div>
                                @Html.Label("", "Nro. Documento", new { @style = "width:auto" })
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="input validate[required] tipright">
                                @Html.TextBox("tb_Cliente")
                            </div>
                        </td>
                        <td>
                            <div class="input validate[required] tipright">
                                @Html.TextBox("tb_NroDocCliente", "", new { @type = "width:auto" })
                            </div>
                        </td>
                    </tr>


                </table>

                <div style="margin-left:auto; padding-top:15px">
                    <input type="submit" value="Buscar" class="submit" />
                </div>
            </center>
        </div>

    }
</div>



@using (Html.BeginForm())
{

    @Html.AntiForgeryToken()

    <div style="padding-top:50px">
        <h4><b>Mostrar Documentos de Venta</b></h4>
        <div class="clear"></div>
        <div class="block big">
            <div class="block_cont">
                <table class="data-table">
                    <thead>
                        <tr>
                            <th>
                                @Html.DisplayName("Codigo del Documento")
                            </th>
                            <th>
                                @Html.DisplayName("Fecha de Pago")
                            </th>
                            <th>
                                @Html.DisplayName("Sub Total")
                            </th>
                            <th>
                                @Html.DisplayName("IGV")
                            </th>
                            <th>
                                @Html.DisplayName("Total")
                            </th>
                            <th>
                                @Html.DisplayName("Estado")
                            </th>
                            <th>
                                @Html.DisplayName("Medio de Pago")
                            </th>
                            <th></th>
                        </tr>
                    </thead>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>
                                @Html.DisplayFor(modelItem => item.IDDocumentoVenta)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.FechaPago)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Subtotal)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.IGV)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Total)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Estado)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.Venta.MedioPago)
                            </td>
                            <td>
                                <input type="button" value="Ver Detalle" class="button" onclick="location.href='@Url.Action("Show", new { id = item.IDDocumentoVenta })'" />
                            </td>
                        </tr>
                    }

                </table>
                <center>
                    <div style="margin-bottom:auto; padding-top:15px">
                        <input type="button" value="Regresar" class="button" onclick="location.href='@Url.Action("Index")'" />
                    </div>
                </center>
            </div>
        </div>
    </div>

    <table>
        <tr></tr>
    </table>
}



